using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._DeepLearning
{
    /// <summary>
    /// <para>Classify Pixels Using Deep Learning</para>
    /// <para>Runs a trained deep learning model on an input image to produce a classified raster published as a hosted imagery layer in your portal.</para>
    /// <para>对输入影像运行经过训练的深度学习模型，以生成在门户中发布为托管影像图层的分类栅格。</para>
    /// </summary>    
    [DisplayName("Classify Pixels Using Deep Learning")]
    public class ClassifyPixelsUsingDeepLearning : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ClassifyPixelsUsingDeepLearning()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputRaster">
        /// <para>Input Raster</para>
        /// <para>The input image to classify. It can be an image service URL, a raster layer, an image service, a map server layer, or an Internet tiled layer.</para>
        /// <para>要分类的输入图像。它可以是影像服务 URL、栅格图层、影像服务、地图服务器图层或 Internet 切片图层。</para>
        /// </param>
        /// <param name="_inputModel">
        /// <para>Input Model</para>
        /// <para>The input is a URL of a deep learning package (.dlpk) item. It contains the path to the deep learning binary model file, the path to the Python raster function to be used, and other parameters such as preferred tile size or padding.</para>
        /// <para>输入是深度学习包 （.dlpk） 项的 URL。它包含深度学习二进制模型文件的路径、要使用的 Python 栅格函数的路径以及其他参数，例如首选切片大小或填充。</para>
        /// </param>
        /// <param name="_outputName">
        /// <para>Output Name</para>
        /// <para>The name of the image service of the classified pixels.</para>
        /// <para>分类像素的影像服务的名称。</para>
        /// </param>
        public ClassifyPixelsUsingDeepLearning(object _inputRaster, object _inputModel, object _outputName)
        {
            this._inputRaster = _inputRaster;
            this._inputModel = _inputModel;
            this._outputName = _outputName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Classify Pixels Using Deep Learning";

        public override string CallName => "ra.ClassifyPixelsUsingDeepLearning";

        public override List<string> AcceptEnvironments => ["cellSize", "extent", "outputCoordinateSystem", "parallelProcessingFactor", "processorType", "snapRaster"];

        public override object[] ParameterInfo => [_inputRaster, _inputModel, _outputName, _modelArguments, _outRaster, _processingMode.GetGPValue()];

        /// <summary>
        /// <para>Input Raster</para>
        /// <para>The input image to classify. It can be an image service URL, a raster layer, an image service, a map server layer, or an Internet tiled layer.</para>
        /// <para>要分类的输入图像。它可以是影像服务 URL、栅格图层、影像服务、地图服务器图层或 Internet 切片图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputRaster { get; set; }


        /// <summary>
        /// <para>Input Model</para>
        /// <para>The input is a URL of a deep learning package (.dlpk) item. It contains the path to the deep learning binary model file, the path to the Python raster function to be used, and other parameters such as preferred tile size or padding.</para>
        /// <para>输入是深度学习包 （.dlpk） 项的 URL。它包含深度学习二进制模型文件的路径、要使用的 Python 栅格函数的路径以及其他参数，例如首选切片大小或填充。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Model")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputModel { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para>The name of the image service of the classified pixels.</para>
        /// <para>分类像素的影像服务的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputName { get; set; }


        /// <summary>
        /// <para>Model Arguments</para>
        /// <para>The function arguments are defined in the Python raster function class referenced by the input model. This is where you list additional deep learning parameters and arguments for experiments and refinement, such as a confidence threshold for adjusting the sensitivity. The names of the arguments are populated by the tool from reading the Python module on the RA server.</para>
        /// <para>函数参数在输入模型引用的 Python 栅格函数类中定义。在这里，您可以列出用于实验和优化的其他深度学习参数和参数，例如用于调整灵敏度的置信度阈值。参数的名称由工具通过读取 RA 服务器上的 Python 模块来填充。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Model Arguments")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _modelArguments { get; set; } = null;


        /// <summary>
        /// <para>Updated Input Raster</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outRaster { get; set; }


        /// <summary>
        /// <para>Processing Mode</para>
        /// <para><xdoc>
        ///   <para>Specifies how all raster items in a mosaic dataset or an image service will be processed. This parameter is applied when the input raster is a mosaic dataset or an image service.</para>
        ///   <bulletList>
        ///     <bullet_item>Process as mosaicked image—All raster items in the mosaic dataset or image service will be mosaicked together and processed. This is the default.</bullet_item><para/>
        ///     <bullet_item>Process all raster items separately—All raster items in the mosaic dataset or image service will be processed as separate images.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何处理镶嵌数据集或影像服务中的所有栅格项目。当输入栅格为镶嵌数据集或影像服务时，将应用此参数。</para>
        ///   <bulletList>
        ///     <bullet_item>处理为镶嵌影像 - 镶嵌数据集或影像服务中的所有栅格项目都将一起镶嵌并进行处理。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>单独处理所有栅格项目 - 镶嵌数据集或影像服务中的所有栅格项目都将作为单独的影像进行处理。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Processing Mode")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _processingMode_value _processingMode { get; set; } = _processingMode_value._PROCESS_AS_MOSAICKED_IMAGE;

        public enum _processingMode_value
        {
            /// <summary>
            /// <para>Process as mosaicked image</para>
            /// <para>Process as mosaicked image—All raster items in the mosaic dataset or image service will be mosaicked together and processed. This is the default.</para>
            /// <para>处理为镶嵌影像 - 镶嵌数据集或影像服务中的所有栅格项目都将一起镶嵌并进行处理。这是默认设置。</para>
            /// </summary>
            [Description("Process as mosaicked image")]
            [GPEnumValue("PROCESS_AS_MOSAICKED_IMAGE")]
            _PROCESS_AS_MOSAICKED_IMAGE,

            /// <summary>
            /// <para>Process all raster items separately</para>
            /// <para>Process all raster items separately—All raster items in the mosaic dataset or image service will be processed as separate images.</para>
            /// <para>单独处理所有栅格项目 - 镶嵌数据集或影像服务中的所有栅格项目都将作为单独的影像进行处理。</para>
            /// </summary>
            [Description("Process all raster items separately")]
            [GPEnumValue("PROCESS_ITEMS_SEPARATELY")]
            _PROCESS_ITEMS_SEPARATELY,

        }

        public ClassifyPixelsUsingDeepLearning SetEnv(object cellSize = null, object extent = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object snapRaster = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, snapRaster: snapRaster);
            return this;
        }

    }

}